using System.Windows.Controls;
using FluentSilverlight.Expressions;

namespace FluentSilverlight.Binders
{
    public static class ControlBinderViewExtensions
    {
        public static TextBoxBinder<TModel> WithTextBox<TModel>(this IOpinionatedControl<TModel> view, TextBox control)
            where TModel : class
        {
            return new TextBoxBinder<TModel>(view.Model, control);
        }

        public static TextBlockBinder<TModel> WithTextBlock<TModel>(this IOpinionatedControl<TModel> view, TextBlock control)
            where TModel : class
        {
            return new TextBlockBinder<TModel>(view.Model, control);
        }

        public static ToggleButtonBinder<TModel> WithCheckBox<TModel>(this IOpinionatedControl<TModel> view, CheckBox control)
            where TModel : class
        {
            return new ToggleButtonBinder<TModel>(view.Model, control);
        }

        public static ButtonBinder<TModel> WithButton<TModel>(this IOpinionatedControl<TModel> view, Button control)
            where TModel : class
        {
            return new ButtonBinder<TModel>(view.Model, control);
        }
    }
}